package Mangos::DB::Mangos::NpcVendor;

use strict;
use warnings;

use base qw(Mangos::DB::Mangos);

__PACKAGE__->meta->setup
(
    table   => 'npc_vendor',

    columns => 
    [
        entry        => { type => 'integer', not_null => 1 },
        item         => { type => 'integer', not_null => 1 },
        maxcount     => { type => 'integer', default => '0', not_null => 1 },
        incrtime     => { type => 'integer', default => '0', not_null => 1 },
        ExtendedCost => { type => 'integer', default => '0', not_null => 1 },
    ],

    relationships =>
    [
 
        CreatureTemplate =>
        {
            type => 'many to one',
            class => 'Mangos::DB::Mangos::CreatureTemplate',
            column_map => { entry => 'entry' },
        },
 
        ItemTemplate =>
        {
            type => 'many to one',
            class => 'Mangos::DB::Mangos::ItemTemplate',
            column_map => { item => 'entry' },
        }
    ],

    primary_key_columns => [ 'entry', 'item' ],
);

1;

package Mangos::DB::Mangos::NpcVendor::Manager;

use strict;
use warnings;

use base 'Rose::DB::Object::Manager';

sub object_class { 'Mangos::DB::Mangos::NpcVendor' }

__PACKAGE__->make_manager_methods('npc_vendor');

1;
